import ErrorTableConConstructor from './index.vue'

// declare module 'vue/types/vue' {
//   interface VueConstructor {
//     initInstance: Function
//     show: Function
//   }
// }

interface errorTableOption {
  reGetFn: Function
  recordid?: string
  type: string
}

let instance: any
let init = (option: errorTableOption) => {
  if (!instance) {
    instance = new ErrorTableConConstructor({ data: option })
    instance.$mount()
    console.log(instance)

    document.body.appendChild(instance.$el) //
  }
}

let show = (option: errorTableOption) => {
  init(option)
  instance.isDisplayErrorDialog = true
  instance.reFindList()
}

export default { show }
